import request from '@/router/axios'
import {fenExYuangettoFixed2, numToTwoPoint,getWOGZYYS,getSJLX,getCSYY,getTKYY,getGZYYS,getPZ} from "../../../commonCheck";
export const swStInputPassengerWorkCashOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  selection: true,
  reserveSelection:false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  },{
    label: '事件详情',
    prop: 'eventDetailName',
    hide: false,
    search: false
  },{
    label: '处理结果',
    prop: 'handleResult',
    hide: false,
    search: false
  },{
    label: '金额',
    prop: 'amount',
    formatter:function(row, value , label, column){
      // var num =value / 100;
      // num = num.toFixed(2);
      if(value){
        value=value.toFixed(2);
      }
      return value;
    },
    search: false,
    hide: false,
  },{
    label: '备注',
    prop: 'remark',
    hide: false,
    search: false
  },{
    label: '事务发生时间',
    prop: 'workTime',
    format: 'yyyy-MM-dd HH:mm:ss',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    width: 120,
    type:'datetime',
    hide: false,
    search: false
  },{
    label: '图片',
    prop: 'filePath',
    hide: false,
    slot:true,
    formslot:true,
    search: false
  },{
    label: '审批状态',
    prop: 'auditStatus',
    type: 'select',
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    },
    search: false,
    hide: false,
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '正确金额',
    prop: 'auditAmount',
    formatter:function(row, value , label, column){
      return value;
    },
    hide: false,
    search: false
  },{
    hide: false,
    width: 160,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export const swStInputPassengerWorkElectronOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  selection: true,
  reserveSelection:false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  },{
    label: '事件详情',
    prop: 'eventDetailName',
    hide: false,
    search: false
  },{
    label: '处理结果',
    prop: 'handleResult',
    hide: false,
    search: false
  },{
    label: '金额',
    prop: 'amount',
    formatter:function(row, value , label, column){
      return numToTwoPoint(value);
    },
    search: false,
    hide: false,
  },{
    label: '备注',
    prop: 'remark',
    search: false,
    hide: false,
  },{
    width: 120,
   label: '事务发生时间',
    prop: 'workTime',
    format: 'yyyy-MM-dd HH:mm:ss',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    type:'datetime',
    hide: false,
    search: false
  },{
    label: '图片',
    prop: 'filePath',
    hide: false,
    slot:true,
    formslot:true,
    search: false
  },{
    label: '审批状态',
    prop: 'auditStatus',
    type: 'select',
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    },
    search: false,
    hide: false,
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '正确金额',
    prop: 'auditAmount',
    formatter:function(row, value , label, column){
      return value;
    },
    hide: false,
    search: false
  },{
    hide: false,
    width: 160,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export const swStInputPassengerWorkPayOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  selection: true,
  reserveSelection:false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    hide: true
  },
    {
    label: '事件详情',
    prop: 'eventDetailName',
    hide: false,
    search: false
  },{
    label: '张数',
    prop: 'sellNumber',
    hide: false,
    search: false
  },{
    label: '金额',
    prop: 'amount',
    formatter:function(row, value , label, column){
      return numToTwoPoint(value);
    },
    search: false,
    hide: false,
  },{
      label: 'SC金额',
      prop: 'sc_amount',
      formatter:function(row, value , label, column){
        return numToTwoPoint(value);
      },
      search: false,
      hide: true,
    }, {
    label: '备注',
    prop: 'remark',
    search: false,
    hide: false,
  },{
    label: '图片',
    prop: 'filePath',
    hide: false,
    slot:true,
    formslot:true,
    search: false
  },{
    width: 120,
    label: '事务发生时间',
    prop: 'workTime',
    format: 'yyyy-MM-dd HH:mm:ss',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    type:'datetime',
    hide: false,
    search: false
  },{
    label: '审批状态',
    prop: 'auditStatus',
    type: 'select',
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    },
    search: false,
    hide: false,
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '正确金额',
    prop: 'auditAmount',
    hide: false,
    search: false,
    formatter:function(row, value , label, column){
      return value;
    }
  },{
    hide: false,
    width: 160,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export const swStInputPassengerWorkSpecialOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  selection: true,
  reserveSelection:false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  },{
      width: 120,
      label: '收入日期',
      prop: 'workDate',
      disabled:true,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      type:'date',
    },{
    width: 160,
    label: '现役军人、武警、消防员发放张数',
    disabled:true,
    prop: 'soliderNumber',
  },{
    width: 160,
    label: '离退休干部士官、部分优抚对象发放张数',
    disabled:true,
    prop: 'f1',
  },{
    width: 160,
    label: '现役军人、武警、消防员专窗张数',
    disabled:true,
    prop: 'f3',
  },{
    width: 160,
    label: '残疾人等发放张数',
    disabled:true,
    prop: 'f2',
  },{
    width: 160,
    label: '其他情况发放张数',
    disabled:true,
    prop: 'otherNumber',
  },{
    width: 120,
    label: '合计销售张数',
    disabled:true,
    prop: 'sellNumber',
  },
  //   {
  //   label: '事务发生日期',
  //   prop: 'workTime',
  //   disabled:true,
  //   format: 'yyyy-MM-dd',
  //   valueFormat: 'yyyy-MM-dd',
  //   type:'date',
  // },      
    {
    label: '上传截图',
    disabled:false,
    slot:true,
    formslot:true,
    prop: 'filePath',
    type:'image',
  },{
    label: '审批状态',
    prop: 'auditStatus',
    disabled:true,
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    }
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '正确张数',
    prop: 'auditNumber',
    hide: false,
    search: false
  },{
    hide: false,
    width: 160,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export const swStInputPassengerWorkFreeOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  selection: true,
  reserveSelection:false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  },{
    width: 120,
    label: '收入日期',
    prop: 'workDate',
    disabled:true,
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    type:'date',
  },{
    width: 140,
    label: '闸门被误用张数',
    disabled:true,
    prop: 'gateMisuseNumber',
  },{
    width: 140,
    label: '手机无电张数',
    disabled:true,
    prop: 'mobileNoeleNumber',
  },{
    width: 140,
    label: '车票非人损张数',
    prop: 'ticketDamageNumber',
    disabled:true,
  },{
    label: '其他张数',
    prop: 'otherNumber',
    disabled:true
  },
    {
      label: 'SC金额',
      prop: 'sc_amount',
      formatter:function(row, value , label, column){
        return numToTwoPoint(value);
      },
      search: false,
      hide: true,
    },{
    label: '合计',
    prop: 'total',
    disabled:true
  },{
    label: '上传截图',
    disabled:false,
    slot:true,
    formslot:true,
    prop: 'filePath',
    type:'image',
  },{
    label: '审批状态',
    prop: 'auditStatus',
    disabled:true,
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    }
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '正确张数',
    prop: 'auditNumber',
    hide: false,
    search: false
  },{
    width: 160,
    hide: false,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export const swStInputPassengerWorkRefundOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  selection: true,
  reserveSelection:false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  },{
    label: '事件详情',
    prop: 'failureOperator',
    formatter:function(row, value , label, column){
      return getGZYYS(value);
    },
    hide: false,
    search: false
  },{
    label: '故障次数',
    prop: 'failureTimes',
    hide: false,
    search: false
  },{
    label: '退款金额',
    prop: 'amountRefunded',
    formatter:function(row, value , label, column){
      return numToTwoPoint(value);
    },
    search: false,
    hide: false,
  },{
    label: '图片',
    prop: 'filePath',
    hide: false,
    slot:true,
    formslot:true,
    search: false
  },{
    width: 120,
    label: '事务发生时间',
    prop: 'workTime',
    format: 'yyyy-MM-dd HH:mm:ss',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    type:'datetime',
    hide: false,
    search: false
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '审批状态',
    prop: 'auditStatus',
    disabled:true,
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    }
  },{
    label: '正确金额',
    prop: 'auditAmount',
    formatter:function(row, value , label, column){
      return value;
    },
    hide: false,
    search: false
  },{
    width: 160,
    hide: false,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export const swStInputPassengerWorkTicketOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  selection: true,
  reserveSelection:false,
  align: 'center',
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  },{
    width: 170,
    label: '旧卡号/订单号',
    prop: 'cardOrder',
    hide: false,
    search: false
  },{
    width: 160,
    label: '替换卡号/商户号',
    prop: 'replaceCardOrder',
    hide: false,
    search: false
  },{
    label: '车票名称',
    prop: 'ticketTypeName',
    hide: false,
    search: false
  },{
    label: '退款原因',
    prop: 'handleType',
    formatter:function(row, value , label, column){
      return getTKYY(value);
    },
    hide: false,
    search: false
  },{
    width: 120,
    label: '替换车票名称',
    prop: 'replaceTicketName',
    hide: false,
    search: false
  },{
    label: '金额',
    prop: 'amount',
    formatter:function(row, value , label, column){
      return numToTwoPoint(value);
    },
    search: false,
    hide: false,
  },{
    width: 120,
    label: '乘客签名照片',
    prop: 'filePath',
    hide: false,
    slot:true,
    formslot:true,
    search: false
  },{
    label: '审批状态',
    prop: 'auditStatus',
    type: 'select',
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    }
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '正确金额',
    prop: 'auditAmount',
    formatter:function(row, value , label, column){
      return value;
    },
    hide: false,
    search: false
  },{
    width: 160,
    hide: false,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export const swStInputPassengerWorkOtherOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  selection: true,
  reserveSelection:false,
  addBtn: false,
  column: [{
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  },{
    label: '(故障/发售)运营商',
    prop: 'failureOperator',
    formatter:function(row, value , label, column){
      return getWOGZYYS(value);
    },
    hide: false,
    search: false,
    width: 150
  },{
    label: '(进/出站)售卖运营商',
    prop: 'sellOperator',
    formatter:function(row, value , label, column){
      return getWOGZYYS(value);
    },
    hide: false,
    search: false,
    width: 150
  },
  {
    type: "select",
    label: '数据类型',
    prop: 'dataType',
    dicUrl: '/support/swpmworkotherdatatype/dict',
    props: {
      label: 'mainName',
      value: 'mainDataValue'
    },
    cascaderItem: ["happenCause"],
    hide: false,
    search: false,
    width: 120
  },{
    label: '产生原因',
    prop: 'happenCause',
    dicFlag: false,
    props: {
      label: 'subName',
      value: 'subDataValue'
    },
    dicUrl: '/support/swpmworkotherhappencause/dict/{{key}}',
    width: 200,
    hide: false,
    search: false
  },
  // {
  //   label: '数据类型',
  //   prop: 'dataType',
  //   formatter:function(row, value , label, column){
  //     return getSJLX(value);
  //   },
  //   hide: false,
  //   search: false,
  // },{
  //   label: '产生原因',
  //   prop: 'happenCause',
  //   formatter:function(row, value , label, column){
  //     return getCSYY(value);
  //   },
  //   hide: false,
  //   search: false
  // },
  {
    label: '张数',
    prop: 'ticketNumber',
    hide: false,
    search: false
  },{
    label: '金额',
    prop: 'amount',
    formatter:function(row, value , label, column){
      return numToTwoPoint(value);
    },
    search: false,
    hide: false,
  },{
    label: '备注',
    prop: 'remark',
    hide: false,
    search: false
  },{
    label: '录入时间',
    prop: 'inputTime',
    hide: false,
    search: false
  },{
    label: '审批状态',
    prop: 'auditStatus',
    type: 'select',
    formatter:function(row, value , label, column){
      return value == 1?'未审批':value == 2?'审批通过':'审批未通过';
    }
  },{
    label: '原因',
    prop: 'reason',
    hide: false,
    search: false
  },{
    label: '正确金额',
    prop: 'auditAmount',
    formatter:function(row, value , label, column){
      return value;
    },
    hide: false,
    search: false
  },{
    width: 160,
    hide: false,
    label: '是否加入报表差错',
    prop: 'isAddReprotError',
    type:'select',
    //search: true,
    dicData: [{
      label: '是',
      value: '1'
    },{
      label: '否',
      value: '0'
    }]
  }]
};

export function getSwStInputPassengerWorkCash(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkCash',
    method: 'post',
    params: param
  })
}
export function getSwStInputPassengerWorkElectron(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkElectron',
    method: 'post',
    params: param
  })
}
export function getSwStInputPassengerWorkPay(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkPay',
    method: 'post',
    params: param
  })
}
export function getSwStInputPassengerWorkSpecial(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkSpecial',
    method: 'post',
    params: param
  })
}
export function getSwStInputPassengerWorkFree(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkFree',
    method: 'post',
    params: param
  })
}
export function getSwStInputPassengerWorkRefund(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkRefund',
    method: 'post',
    params: param
  })
}
export function getSwStInputPassengerWorkTicket(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkTicket',
    method: 'post',
    params: param
  })
}
export function getSwStInputPassengerWorkOther(param) {
  return request({
    url: '/check/check/getSwStInputPassengerWorkOther',
    method: 'post',
    params: param
  })
}
export function updateTransactionAudit(param) {
  return request({
    url: '/check/check/updateTransactionAudit',
    method: 'post',
    params: param
  })
}
export function updateTransactionAuditToF(param) {
  return request({
    url: '/check/check/updateTransactionAuditToF',
    method: 'post',
    params: param
  })
}
export function updateTransactionAuditToPKCY(param) {
  return request({
    url: '/check/check/updateTransactionAuditToPKCY',
    method: 'post',
    params: param
  })
}  
export function queryCKSWCount(param) {
  return request({
    url: '/check/check/queryCKSWCount',
    method: 'post',
    params: param,
    data: param
  })
}
export function queryScTicketCountAndMoney(param) {
  return request({
    url: '/check/check/queryScTicketCountAndMoney',
    method: 'post',
    params: param,
    data: param
  })
}
